import {createRouter, createWebHashHistory, createWebHistory} from "vue-router"
import HelloWorld from "../src/components/HelloWorld.vue"
import Resume from "../src/pages/resume/Resume.vue"

const routes = [
    {
        path: "/",
        component: HelloWorld
    },
    {
        path: "/re",
        component: Resume
    }
]

const router = createRouter({
    scrollBehavior(to) {
        if (to.hash) {
            return {
                el: to.hash,
                behavior: 'smooth',
                top: 45,
            }
        }
    },
    history: createWebHashHistory(),
    routes,
})

export default router
